package org.springblade.app.feign;

import org.springblade.app.constant.AppConstant;
import org.springblade.applicationapi.entity.App;
import org.springblade.common.constant.LauncherConstant;
import org.springblade.core.tool.api.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author zhangyr
 * @version 1.0
 * @date 2022-08-25 10:34
 * @description 单点登录应用管理
 */
@FeignClient(
	value = LauncherConstant.APPLICATION_application_ADMIN_NAME,
	fallback = ISubAppClientFallback.class
)
public interface IAppClient {
	/**
	 * description:  添加应用<br>
	 * date: 2022/4/6 9:55 <br>
	 * author: yzpang <br>
	 * param:
	 * @return
	 **/
	@PostMapping("/app/add")
	R<App> addApp(@RequestBody App app);

	/**
	 * description:刷新appsecret <br>
	 * date: 2022/4/6 9:55 <br>
	 * author: yzpang <br>
	 * param:
	 * @return
	 **/
	@PostMapping("/app/refresh")
	R<App> refreshSecret(@RequestParam("appid") String appid);

	@PostMapping("/app/remove")
	R deleteApp(@RequestParam("ids")String ids);

}
